<template>
  <div>
    <van-nav-bar title="立即购买" left-arrow @click-left="onClickLeft" />

    <van-card :price="list.price" :title="list.name" :thumb="list.img" />
    <van-action-bar>
      <van-action-bar-button type="danger" text="立即购买" />
    </van-action-bar>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import { getgoodsDetail } from "../api/index.js";

const route = useRoute()
const list = ref({})
const getlist = async () => {
  let res = await getgoodsDetail(route.query)
  console.log(res);
  list.value = res.data.data.goodsData
}
getlist()
const onClickLeft = () => history.back();
</script>

<style lang="scss" scoped>
::v-deep .van-card__price {
  color: red;
}
</style>